package com.xquant.marketdata.marketdata.controller;

import com.github.pagehelper.PageInfo;
import com.xquant.marketdata.marketdata.service.FundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

import static com.xquant.common.core.utils.PageUtils.startPage;

/**
 * 下拉框查询
 *
 * @author ershuai.zhao
 */
@RestController
@RequestMapping("fundController")
public class FundController {

    @Autowired
    private FundService fundService;

    /**
     * 查询 基金信息
     */
    @RequestMapping(value = "/queryFundInfoByPage.action")
//    @PreAuthorize("@ss.hasPermi('marketdata:equity:fund:fundInfo:list')")
    public PageInfo<Map> queryFundInfoByPage(@RequestParam Map<String, Object> param) {
        startPage();
        PageInfo<Map> pageInfo = fundService.queryFundInfoByPage(param);
        return pageInfo;
    }
    /**
     * 查询 基金分红
     */
    @RequestMapping(value = "/queryFundDividendByPage.action")
//    @PreAuthorize("@ss.hasPermi('marketdata:equity:fund:fundBonus:list')")
    public PageInfo<Map> queryFundDividendByPage(@RequestParam Map<String, Object> param) {
        startPage();
        PageInfo<Map> pageInfo = fundService.queryFundDividendByPage(param);
        return pageInfo;
    }
    /**
     * 查询 基金行情
     */


    @RequestMapping(value = "/queryFundPriceByPage.action")
//    @PreAuthorize("@ss.hasPermi('marketdata:equity:fund:fundQuota:list')")
    public PageInfo<Map> queryFundPriceByPageByPage(@RequestParam Map<String, Object> param) {
        startPage();
        PageInfo<Map> pageInfo = fundService.queryFundPriceByPage(param);
        return pageInfo;
    }

}
